import axios from 'axios'
axios.defaults.headers.common['authorization'] = "Bearer "+localStorage.getItem('token')
//获取收货地址列表
export function getaddresses() {
  return axios.get('http://api.cat-shop.penkuoer.com/api/v1/addresses');
}
//获取单条收货地址
export function getaddress(id) {
  return axios.get('http://api.cat-shop.penkuoer.com/api/v1/addresses/'+id);
}
//收货地址新增
export function addaddress(model) {
  return axios.post('http://api.cat-shop.penkuoer.com/api/v1/addresses/',model);
}
//收货地址修改
export function editaddress(id,q) {
  return axios.put('http://api.cat-shop.penkuoer.com/api/v1/addresses/'+id,q);
}
//收货地址删除
export function deladdress(id) {
  return axios.delete('http://api.cat-shop.penkuoer.com/api/v1/addresses/'+id);
}

